#ifndef LEADERBOARDLOGIC_H
#define LEADERBOARDLOGIC_H

#define MAX_PLAYERS 20
#define NAME_LEN 32

typedef struct {
    char name[NAME_LEN];
    int score;
} Player;

typedef struct {
    Player players[MAX_PLAYERS];
    int count;
} Leaderboard;

void leaderboardInit(Leaderboard* lb);
void leaderboardAdd(Leaderboard* lb, const char* name, int score);
int leaderboardCmpScoreDesc(const void* a, const void* b);
void leaderboardSortByScore(Leaderboard* lb);

#endif 